import request from "@/utils/request";
import {
    Common,
    // addRequirementTypeForm,
    createRequirementForm,
    addProjectNameForm,
    postAvgRequirementForm,
    putCloseFatherRequirementStatusForm,
    putReturnFatherRequirementStatusForm,
    putUpdateRequmentStatusForm,
    getNewFatherRequirementForm,
    postSubmitTestRequirementForm,
    searchRequirementForm,
    postInitRequirementData,
    postPVPRequirementData,
    getRequirementForm,
    postReviewRequirementMsgForm,
    putAddOrUpdateRequirementBossNameForm,
    putShowNeedTipForm,
    // TODO 任务完成
    postTaskRequirementSuccessForm,
    // TODO 测试中
    putShowTipCTOYForm,
    postAgainRequirementForm,
    putShowTipJTOYForm,
    postSubmitTestStatusForm,
    submitTestRequirementTwoForm,
    getItemListByUserData,
    putTestToBossTipForm,
    // TODO 需求详情
    postAvgDeleteRequirementForm,
    postAddSaidContentsForm,
    getSaidContentListData,
    getOperationHistorysData,
    postRequriementPullBranchForm,
    postRequirementPullBranchData,
    putUpdateChildMagForm,
    getOutTimeRequirementMsgData,
    postOutTimeRequirementMsgForm,
    postAddSubmitTestRequirementForm,
    // TODO 已上线待评价
    getManagerNoToDevRequirementsData,
    postSaveManagerNoToDevRequirementsForm,
    // TODO 项目经理待上线评审
    postManagerRequirementForm,
    postOfflineBearContentForm,
    getSelectBareUsersFormData,
    postOfflineBearContentMsgForm,
    submitBearContentForm,
    postSelectBareUsersForm,
    // TODO 待上线
    postOfflineToEndForm,
    putOnlineEndBearContentsForm,
    // TODO 测试用例
    postRequirementTestCasesForm,
    // 我的上线
    myOfflineRequirementForm,
    updateMyOfflineRequirementForm,
    createOnlinePlanForm,
    getOnlinePlanListForm,
    getOnlinePlanListResponse,
    updateOnlinePlanForm,
} from "./type";

enum NewDemands {
    // PostAddRequirementType = "/item/addRequirementType",//添加需求类型
    PostCreateRequirement = "/item/createRequirement",//创建需求
    PostAddItemItem = "/item/addItemItem",//添加项目名称
    PostInitRequirement = "/item/getInitRequirement",//获取【我负责的需求】
    PostNewInitRequirement = "/item/getNewInitRequirement",//? 获取【我负责的需求】(新)
    PostAvgRequirement = "/item/avgRequirement",//分配需求接口
    PostNewAvgRequirement = "/item/newAvgRequirement",//? 分配需求接口(新)
    PostAddAvgRequirement = "/item/addAvgRequirement",//? 新增任务(新)
    PutCloseFatherRequirementStatus = "/item/closeFatherRequmentStatus",//关闭主需求
    PostPVPRequirement = "/item/getPvPRequirement",//获取【我的研发任务】
    PostAllInitRequirement = "/item/getAllInitRequirement",//? 获取【所有需求】
    PostNewPVPRequirement = "/item/getNewPvPRequirement",//? 获取【我的研发任务】
    PutUpdateRequirementStatus = "/item/updateRequmentStatus",//更新childStatus任务状态
    GetNewFatherRequirementStatus = "/item/getNewFatherRequmentStatus",//更新fatherStatus任务状态
    PostSubmitTestRequirement = "/item/submitTestRequment",//提交测试分支
    PostRequirement = "/item/getRequirement",//查询一个需求
    PostUpdateRequirementName = "/item/updateRequirementName",//修改需求名称
    GetCreateRequirement = "/item/getCreateRequirement",//获取【我创建的需求】数据
    GetEnterRequirement = "/item/getEnterRequirement",//获取【待审核】需求
    PostReviewRequirementMsg = "/item/reviewRequirementMsg",//审核需求
    GetUrged = "/item/urgedUrgedUrged",//催促审核,
    PutUpdateBossName = "/item/addOrUpdateRequirementBossName",//选择技术负责人
    GetRequirementEnterMsg = "/item/getRequirementEnterMsg",//获取需求审核记录
    PutShowNeedTip = "/item/showNeedTip",//提交需求评审会议纪要
    GetJoinTests = "/item/getJoinTests",//获取提测人员列表
    PostAgainRequirement = "/item/againSubmitRequirement",// 审核未通过时修改需求
    PostUpdateRequirementMsg = "/item/updateRequirementMsg",// 更新需求详情
    GetMyRequirementNoTip = "/item/getMyRequirementNoTip",//获取已经提测，未审核的需求
    PutShowTipJTOY = "/item/showTipJTOY",// 技术负责人审核详细设计请求参数
    PutReturnCloseFatherRequirementStatus = "/item/returnCloseFatherRequmentStatus",// 技术负责人撤回已关闭需求
    GetItemListByUser = "/item/getItemListByUser",// 定义获取所有项目名称列表响应参数类型
    // TODO 任务完成
    TaskRequirementSuccess = "/item/taskRequirementSuccess",// 任务完成提交数据

    // TODO 需求详情
    PostAvgDeleteRequirement = "/item/avgDeleteRequirement",// 删除已分配人员
    PostAddSaidContents = "/item/addSaidContents",// 提交留言
    GetSaidContentList = "/item/getSaidContentList",// 获取所有留言
    GetOperationHistorys = "/item/getOperationHistorys",// 获取变更历史
    PostRequriementPullBranch = "/item/getRequirementPullBranch",// 获取提测记录
    PutUpdateChildMsg = "/item/updateChildMsg",// 修改已分配任务
    GetOutTimeRequirementMsg = "/item/getOutTimeRequirementMsg", // 获取任务是否超时及超时内容
    PostOutTimeRequirementMsg = "/item/outTimeRequirementMsg",// 提交任务超时原因
    GetDeleteSubmitTestPersion = "/item/deleteSubmitTestPersion",// 删除任务提测人员
    PostAddSubmitTestRequirement = "/item/addSubmitTestRequment",// 添加提测人员
    // TODO 测试中
    PutShowTipCTOY = "/item/showTipCTOY",// 测试通过时测试对研发评分
    GetUpdateSubmitNotTips = "/item/updateSubmitNotTips", // 测试负责人创建的任务测试通过
    PostSubmitTestStatus = "/item/updateSubmitTestStatus",// 测试不通过时提交bug
    GetRequirementsBugs = "item/getRequirementsBugs",// 根据需求id获取所有bug列表
    FindBugMsgById = "bug/findBugMsgById",// 根据需求id获取bug详情
    GetBugMsgById = "bug/getBugMsgById",// 根据需求id获取bug评论
    AddBugTipsById = "bug/addBugTipsById",// 根据需求id添加bug评论
    GetGetAllOrMyBugList = "bug/getAllOrMyBugList",// 获取所有未修复的bug
    AddNewRequirementBug = "bug/addNewRequirementBug",// 根据需求新建bug
    GetRequirementAllBug = "item/getRequirementAllBug",// 根据需求id和过滤条件获取所有bug
    GetBugStatusList = "bug/getBugStatusList",// 获取bug状态列表
    UpdateBugLevelById = "bug/updateBugLevelById",// 根据bugid更新bug等级
    UpdateBugStatusById = "bug/updateBugStatusById",// 根据bugid更新bug状态
    UpdateBugEditById = "bug/updateBugEditById",// 根据bugid更新bug修复人
    GetBugRequirementList = "item/getBugRequirementList",//获取存在bug的需求和所有需求
    GetMySubmitByRequirementChild = "/item/getMySubmitByRequirementChild",// 测试人员根据需求id获取提测给自己的研发人员名单
    PostSubmitTestRequirementTwo = "/item/submitTestRequirementTwo", // 需求重新提测
    GetSubmitRequirementList = "/item/getSubmitRequirementList",// 研发人员重新提测时获取自己的提测人员列表
    GetUpdateMySubmitByRequirementStatus = "/item/updateStatusMySubmitByRequirementChild",// 变更自己的提测记录为测试中
    GetSubmitTestMsg = "/item/getSubmitTestMsg",// 获取提测需求详情
    PutTestToBossTip = "/item/testToBossTip",// 测试对测试负责人进行评论评分



    PostChangePassword = "/user/changePassword",//修改密码




    // 上线任务接口
    PostCreateOfflineRequirement = "/item/createOfflineRequirement",// 创建上线任务
    GetDeleteOnlineTaskById = "/item/deleteOnlineTaskById",// 删除上线任务
    PostGetOfflineRequirement = "/item/getOfflineRequirement",// 获取上线任务列表
    GetGetOnlineTaskRequirements = "/item/getOnlineTaskRequirements",// 获取上线任务绑定的需求列表
    PostUpdateOfflineRequirement = "/item/updateOfflineRequirement",// 更新上线任务名称
    PostSelectOfflineRequirements = "/item/selectOfflineRequirements",// 选择上线任务的需求
    PostDeleteOnlineTaskInTasks = "/item/deleteOnlineTaskInTasks",// 删除上线任务的一个需求
    PostAddOnlineTaskInTasks = "/item/addOnlineTaskInTasks",// 往上线任务中添加一个需求
    GetGetOfflineRequirementLog = "/item/getOfflineRequirementTrues",// 查询上线任务操作记录
    GetGetOfflineRequirementTrues = "/item/getOfflineRequirementTrues",// 获取可以选择的上线评审的需求
    PostDetermineOfflineTime = "/item/determineOfflineTime",// 指定上线评审时间(支持重新指定也就是修改)
    PostDetermineOnlineTime = "/item/determineOnlineTime",// 指定上线时间(支持重新指定也就是修改)
    PostSelectOnlineTaskBareUsers = "/item/selectOnlineTaskBareUsers",// 选择上线评审参与人、研发、运维、测试
    PostAddOnlineTaskInUser = "/item/addOnlineTaskInUser",// 添加上线评审参与人、研发、运维、测试
    PostUpdateOnlineTaskInUser = "/item/updateOnlineTaskInUser",// 修改上线评审参与人、研发、运维、测试
    GetGetOnlineTaskMsg = "/item/getOnlineTaskMsg",// 查询上线任务上线参与人
    PostDeleteOnlineTaskInUser = "/item/deleteOnlineTaskInUser",// 删除上线任务上线参与人
    PostAddOnlieTaskMeetingNotes = "/item/addOnlieTaskMeetingNotes",// 填写上线评审会议纪要
    PostAddOnlieTaskResources = "/item/addOnlieTaskResources",// 填写上线资源
    GetGetOnlineTaskGuarantors = "/item/getOnlineTaskGuarantors",// 获取所有可选择保障人员
    GetManagerList = "/item/getManagerList",// 获取所有项目经理
    PostAddOnlineTaskGuarantors = "/item/addOnlineTaskGuarantors",// 添加报障人
    GetFindOnlineTaskGuarantors = "/item/findOnlineTaskGuarantors",// 查询上线任务保障人员
    GetDeleteOnlineTaskGuarantors = "/item/deleteOnlineTaskGuarantors",// 删除上线任务保障人员
    // 产品版本
    PostCreateVersion = "/item/createVersion",// 添加产品版本
    PostUpdateVersion = "/item/updateVersion",// 更新产品版本
    PostCreateVersionRating = "/item/createVersionRating",// 产品版本评分评论
    GetDeleteVersion = "/item/deleteVersion",// 删除产品版本
    PostGetVersionList = "/item/getVersionList",// 获取产品版本列表

    // 汇报任务接口
    PostCreateReportMaterial = "/item/createReportMaterial",// 创建汇报任务
    PostUploadReportMaterialFile = "/item/uploadReportMaterialFile",// 提交汇报任务
    GetDeleteReportMaterialById = "/item/deleteReportMaterialById",// 删除上线任务
    PostgetReportMaterialList = "/item/getReportMaterialList",// 获取汇报任务列表，可以根据条件获取自己或者所有人的
    ExportReportMaterialList = "/item/exportReportMaterialList",// 导出汇报材料
    PostUpdateReportMaterialName = "/item/updateReportMaterialName",// 修改汇报任务的名称
    GetGetReportMaterialLogs = "/item/getReportMaterialLogs",// 查看操作历史记录
    PostSubmitReportMaterialAudit = "/item/submitReportMaterialAudit",// 修改汇报任务的名称
    PostAuditNotBy = "/item/auditNotBy",// 审核不通过
    PostAuditBy = "/item/auditBy",// 审核通过
    PostAuditToCreator = "/item/auditToCreator",// 对处理人评价
    GetReturnReportMaterialAudit = "/item/returnReportMaterialAudit",// 撤销审核任务

    // 超时任务接口
    PostGetAllTimeOutIrs = "/item/getAllTimeOutIrs",// 获取所有超时任务


    // TODO 待上线评审需求
    PostManagerRequirement = "/item/getManagerRequirements",// 获取项目经理的待上线评审需求
    GetManagerOnline = "/item/pushManagerOnline",// 项目经理通知技术负责人上线评审
    GetSelectBareUsers = "/item/getSelectBareUsers",// 获取上线评审可参与人员列表
    PostSelectBareUsers = "/item/selectBareUsers",// 技术负责人分配参与上线人员
    GetMyBareMsg = "/item/getMyBareMsg",// 获取【我的上线任务】列表
    SubmitBearContent = "/item/submitBearContent", // 提交上线评审负责内容
    PostOfflineBearContent = "/item/pushOfflineBearContent",// 项目经理通知所有上线参与人线下上线评审时间
    PostOfflineBearContentMsg = "/item/pushOfflineBearContentMsg", // 项目经理填写上线评审会议纪要
    GetRoleUser = "/user/getRoleUser", // 获取所有用户
    PostUpdateBareUsersMsgs = "/item/selectUpdateBareUsers", // 更新参与上线评审的人各自负责的内容
    GetOnlineUsers = "/item/getSelectBareUsers", // 获取上线参与人列表
    DingDingOnlineWriteBearContents = "/item/dingDingOnlineWriteBearContents", // 提醒编写上线负责任务
    GetMyPhoneNumber = "/item/getMyPhoneNumber",// 获取保障人手机号码
    GetFatherTestCaseList = "/item/getFatherTestCaseList", // 获取需求所有测试用例

    // TODO 待上线
    PostOfflineToEnd = "/item/sucssesOfflineToEnd",// 技术负责人提交上线结果
    PutOnlineEndBearContents = "/item/saveOnlineEndBearContents",// 技术负责人/测试负责人对上线参与人评分
    SaveMsOnlineEndBearContents = "/item/saveMsOnlineEndBearContents",// 上传巡检文档
    PostSureOnline = "/item/sureOnline",// 待上线-今天上线时间
    // TODO 已上线
    GetBareUsersMsgs = "/item/getBareUsersMsgs", // 获取已上线待评价人员列表
    // TODO 项目经理已上线未评价
    GetManagerNoToDevRequirements = "/item/getManagerNoToDevRequirements", // 获取项目经理所有已上线未评价需求
    SaveManagerNoToDevRequirements = "/item/saveManagerNoToDevRequirements",// 项目经理提交评价数据
    // TODO 今天上线的任务
    GetThisDayOnlineRequirement = "/item/getThisDayOnlineRequirement", // 获取今日上线需求
    // TODO 测试用例
    GetAllItemCaseNumber = "/case/getAllItemCaseNumber",//获取所有项目测试用例数
    GetItemCaseListById = "/case/getItemCaseListById",//获取指定项目的用例
    AddItemModuleOne = "/item/addItemModuleOne",//添加项目一级功能分类
    AddItemModuleTwo = "/item/addItemModuleTwo",//添加项目二级功能分类
    UpdateItemModuleOne = "/item/updateItemModuleOne",//编辑项目一级功能分类
    UpdateItemModuletwo = "/item/updateItemModuletwo",//编辑项目二级功能分类
    GetItemTwoModuleList = "/item/getItemTwoModuleList",//获取选中一级功能分类的所有二级分类
    GetItemOneModuleList = "/item/getItemOneModuleList",//获取项目所有一级功能模块
    GetDeleteItemCaseModuleOneById = "/case/deleteItemCaseModuleOneById",//删除一级功能模块
    GetDeleteItemCaseModuleTwoById = "/case/deleteItemCaseModuleTwoById",//删除二级功能模块
    GetItemModuleCaseList = "/item/getItemModuleCaseList",//获取项目模块对应的用例
    GetItemRequirementCaseList = "/item/getItemRequirementCaseList",//查询选中项目的所有需求用例
    GetItemRequirementList = "/item/getItemRequirementList",//查询选中项目的所有需求
    AddOneTwoModulItemRequirementList = "/item/addOneTwoModulItemRequirementList",//一级模块和二级模块关联用例
    GetLinkeModulList = "/item/getLinkeModulList",//查询模块已经关联的用例
    UnlinkLinkeModulCase = "/item/unlinkLinkeModulCase",//取消模块已经关联的用例
    GetItemCaseById = "/case/getItemCaseById",//查询用例详情
    DeleteItemCaseById = "/case/deleteItemCaseById",//删除指定用例
    UpdateItemCaseById = "/case/updateItemCaseById",//更新用例详情
    GetItemRequirementListById = "/case/getItemRequirementListById",//获取项目下的所有需求
    GetFatherTestCaseListPage = "/case/getFatherTestCaseListPage",//分页查询需求用例
    GetNowMonthAddCaseTotal = "/case/getNowMonthAddCaseTotal",//获取本月测试新增用例数
    GetNowMonthAddCaseRequirement = "/case/getNowMonthAddCaseRequirement",//获取本月测试新增用例的需求
    GetNowMonthAddCaseByRequirementName = "/case/getNowMonthAddCaseByRequirementName",//根据选中需求的名称获取新增用例
    AuditNowMonthAddCaseById = "/case/auditNowMonthAddCaseById",//审核本月新增用例




    GetChildTestCaseList = "/item/getChildTestCaseList",// 获取任务测试用例
    GetByIdItemCase = "/item/byIdGetItemCase",// 获取项目测试用例
    PostRequirementTestCases = "/item/importOrSelectRequirementTestCases",// 导入或上传任务测试用例
    // 汇报工作量
    GetWorkloadList = "/item/getWorkloadList",// 获取已上线需要汇报工作量的需求
    ExportWorkloadList = "/item/exportWorkloadList",// 导出汇报工作量
    GetWorkloadRequirementList = "/item/getWorkloadRequirementList",// 获取可选择需求列表
    UpdateWorkload = "/item/updateWorkload",// 更新汇报工作量内容
    PostReportWorkloadRequirement = "/item/createWorkload",// 上报工作量
    PostCommentRating = "/item/commentRating",// 给项目经理管理者评分评论
    PostAuditWorkloadRequirement = "/item/auditWorkloadRequirement",// 审核上报工作量
    GetWorkloadRequirement = "/item/getWorkloadRequirement",// 获取审核上报工作量详情
    GetWorkloadRequirementMsg = "/item/getWorkloadRequirementMsg",// 查看工作量审核记录
    NoWorkload = "/item/noWorkload",// 不汇报工作量

    // 我的上线
    MyOfflineRequirement = "/item/myOfflineRequirement",// 获取我的上线任务
    UpdateMyOfflineRequirement = "/item/updateMyOfflineRequirement",// 更新我的上线任务


    // 文件管理
    GetDocumentTree = "/file/getDocumentTree",// 查询文件夹关系
    CreateDocumentTree = "/file/createDocumentTree",// 创建文件夹关系
    UpdateDocumentTreeName = "/file/updateDocumentTreeName",// 修改文件夹或备注名称
    DeleteDocumentTree = "/file/deleteDocumentTree",// 删除文件夹或备注名称
    GetDocumentTreeFiles = "/file/getDocumentTreeFiles",// 查询文件列表接口
    UploadDocumentTreeFile = "/file/uploadDocumentTreeFile",// 指定接口上传接口

    GetRoleUsers = "/user/getRoleUser",//获取对应权限下的角色

    // 加班申请
    GetSelfOverTimeCount = "/item/getSelfOverTimeCount",// 获取本人未提交加班申请的需求
    CreateJobOverTime = "/item/createJobOverTime",// 创建加班申请单
    UpdateJobOverTime = "/item/updateJobOverTime",// 修改加班申请单
    GetJobOverTimeList = "/item/getJobOverTimeList",// 获取我的加班申请单列表
    VoidedJobOverTimeList = "/item/voidedJobOverTimeList",// 作废加班申请单
    GetAuditJobOverTimeList = "/item/getAuditJobOverTimeList",// 获取加班申请列表
    GetAuditJobOverTimeListByUUID = "/item/getAuditJobOverTimeListByUUID",// 根据UUID获取加班申请单(管理员)
    GetAuditJobOverTimeMySign = "/item/getAuditJobOverTimeMySign",// 获取本人签字图片(管理员)
    AuditJobOverTimeById = "/item/auditJobOverTimeById",// 审核加班申请单
    GetJobOverTimeById = "/item/getJobOverTimeById",// 查询加班申请单详情
    PrintJobOverTimeStatus = "/item/printJobOverTimeStatus",// 完成打印的加班申请单
    ExportOverTime = "/item/exportOverTime",// 导出加班申请单


    // 出差记录
    GetItemList = "/item/getItemList",// 获取所有项目
    DeleteTrip = "/item/deleteTrip",// 删除出差记录
    CreateTrip = "/item/createTrip",// 创建出差记录
    UpdateTrip = "/item/updateTrip",// 修改出差记录
    GetTripList = "/item/getTripList",// 查询出差记录
    ExportReportTrip = "/item/exportReportTrip",// 导出出差记录

    // 会议记录
    CreateMeeting = "/item/createMeeting",//创建会议记录
    UpdateMeeting = "/item/updateMeeting",//更新会议记录
    GetMeetingList = "/item/getMeetingList",//查询会议记录
    ExportReportMeeting = "/item/exportReportMeeting",//导出会议记录
    DeleteMeeting = "/item/deleteMeeting",//删除会议记录

    // 日报记录
    CreateDaily = "/item/createDaily",//创建日报记录
    GetDailyList = "/item/getDailyList",//查询日报记录
    ToComments = "/item/toComments",//评论日报
    GetDailyById = "/item/getDailyById",//查询日报详情
    GetToComments = "/item/getToComments",//查询日报评论记录
    GetDailySelectIds = "/item/getDailySelectIds",//查询可查看的日报ID列表
    GetMyDailyOneToMany = "/item/getMyDailyOneToMany",//获取可选未完成安排需求
    GetDailyUserListByDepartment = "/item/getDailyUserListByDepartment",// 根据部门查询对应的用户

    // 人员管理
    GetTeamUsers = "/persion/getTeamUsers",// 获取团队人员数据
    UploadUserHeadImg = "/user/UploadUserHeadImg",// 更换头像
    AddPosition = "/user/AddPosition",// 新增职位
    UpdatePositionById = "/user/updatePositionById",// 更新职位
    UpdatePositionType = "/user/updatePositionType",// 更新绩效类型
    AssPositionUser = "/user/assPositionUser",// 绩效职位关联用户
    GetPositionList = "/user/getPositionList",// 获取所有的职位
    GetPositionTypeListByPositionId = "/user/getPositionTypeListByPositionId",// 获取制定职位的绩效类型
    GetPositionUser = "/user/getPositionUser",// 获取参与绩效计算的用户
    GetPositionUserByPositionId = "/user/getPositionUserByPositionId",// 获取已关联职位的用户


    // 代办数据
    CreateUpdateAgency = "/item/createUpdateAgency",//创建或编辑代办数据
    GetAgencyList = "/item/getAgencyList",//查询代办数据
    DeleteAgencyById = "/item/deleteAgencyById",//删除代办数据
    OverAgencyById = "/item/overAgencyById",//完成代办数据
    CheckAgencyById = "/item/checkAgencyById",// 根据ID查看代办数据

    // 老王操作数据
    GetOverTimeList = "/item/getOverTimeList",// 获取所有调休加班记录
    UpdateOverTimeRemarks = "/item/updateOverTimeRemarks",// 更新备注信息
    SummaryJobOverTimeLong = "/item/summaryJobOverTimeLong",// 汇总调休加班记录
    ResetJobOverTimeLong = "/item/resetJobOverTimeLong",// 重置调休数据
    ExportReportLeave = "/item/exportReportLeave",// 导出调休加班记录
    UpdateOverTimelong = "/item/updateOverTimelong",// 录入调休时长
    
    // 上线计划
    CreateOnlinePlan = "/item/createOnlinePlan",// 创建上线计划
    GetOnlinePlanList = "/item/getOnlinePlanList",// 查询上线计划列表
    UpdateOnlinePlan = "/item/updateOnlinePlan",// 更新上线计划
    DeleteOnlinePlan = "/item/deleteOnlinePlan",// 删除上线计划
    
    // 差的日报绩效
    SummaryItemPoorDailyReports = "/item/summaryItemPoorDailyReports",// 汇总差的日报绩效
    GetSummaryItemPoorDailyReports = "/item/getSummaryItemPoorDailyReports",// 获取汇总后差的日报绩效
    ResetSummaryItemPoorDailyReports = "/item/resetSummaryItemPoorDailyReports",// 重新汇总差的日报绩效
    SaveSummaryItemPoorDailyReports = "/item/saveSummaryItemPoorDailyReports",// 差的日报绩效存为历史数据
    
    // 日报重复率绩效
    SummaryItemDailyReportRepetitionRate = "/item/summaryItemDailyReportRepetitionRate",// 汇总日报重复率绩效
    GetSummaryItemDailyReportRepetitionRate = "/item/getSummaryItemDailyReportRepetitionRate",// 获取汇总后日报重复率绩效
    ResetSummaryItemDailyReportRepetitionRate = "/item/resetSummaryItemDailyReportRepetitionRate",// 重新汇总日报重复率绩效
    SaveSummaryItemDailyReportRepetitionRate = "/item/saveSummaryItemDailyReportRepetitionRate",// 日报重复率绩效存为历史数据
}

// 上线计划-创建
export const CreateOnlinePlan = (data: createOnlinePlanForm) => request.post<Common<any>>(NewDemands.CreateOnlinePlan, data);
export const createOnlinePlan = CreateOnlinePlan;

// 上线计划-查询
export const GetOnlinePlanList = (data: getOnlinePlanListForm) => request.post<Common<getOnlinePlanListResponse>>(NewDemands.GetOnlinePlanList, data);
export const getOnlinePlanList = GetOnlinePlanList;

// 上线计划-更新
export const UpdateOnlinePlan = (data: updateOnlinePlanForm) => request.post<Common<any>>(NewDemands.UpdateOnlinePlan, data);
export const updateOnlinePlan = UpdateOnlinePlan;

// 上线计划-删除
export const DeleteOnlinePlan = (id: number) => request.get<Common<any>>(`${NewDemands.DeleteOnlinePlan}?id=${id}`);
export const deleteOnlinePlan = DeleteOnlinePlan;

// 添加需求类型
// export const postAddRequirementType = (data: addRequirementTypeForm) => request.post<Common<{}>>(NewDemands.PostAddRequirementType, data);

// 创建需求
export const postCreateRequirement = (data: createRequirementForm) => request.post<Common<any>>(NewDemands.PostCreateRequirement, data);

// 添加项目名称
export const postAddItmeItem = (data: addProjectNameForm) => request.post<Common<any>>(NewDemands.PostAddItemItem, data);

// 定义获取所有项目名称列表响应参数类型
export const GetItemListByUser = () => request.get<getItemListByUserData>(NewDemands.GetItemListByUser);

// 获取【我负责的需求】
export const postInitRequirement = (data: searchRequirementForm) => request.post<postInitRequirementData>(NewDemands.PostInitRequirement, data);

//? 获取【我负责的需求】(新)
export const postNewInitRequirement = (data: searchRequirementForm) => request.post<any>(NewDemands.PostNewInitRequirement, data);

// 分配需求
export const postAvgRequirement = (data: postAvgRequirementForm) => request.post<Common<any>>(NewDemands.PostAvgRequirement, data);

//? 分配需求(新)
export const postNewAvgRequirement = (data: any) => request.post<Common<any>>(NewDemands.PostNewAvgRequirement, data);

//? 分配需求(新)
export const postAddAvgRequirement = (data: any) => request.post<Common<any>>(NewDemands.PostAddAvgRequirement, data);

// 关闭未分配需求
export const putCloseRequirementStatus = (data: putCloseFatherRequirementStatusForm) => request.put<Common<any>>(NewDemands.PutCloseFatherRequirementStatus, data);

// 获取【我的研发任务】
export const postPVPRequirement = (data: searchRequirementForm) => request.post<postPVPRequirementData>(NewDemands.PostPVPRequirement, data);

//? 获取【所有需求】
export const postAllInitRequirement = (data: searchRequirementForm) => request.post<any>(NewDemands.PostAllInitRequirement, data);

//? 获取【我的研发任务】
export const postNewPVPRequirement = (data: searchRequirementForm) => request.post<any>(NewDemands.PostNewPVPRequirement, data);

// 更新childStatus任务状态
export const putUpdateRequirementStatus = (data: putUpdateRequmentStatusForm) => request.put<Common<any>>(NewDemands.PutUpdateRequirementStatus, data);

// 更新fatherStatus任务状态
export const getNewFatherRequirementStatus = (data: getNewFatherRequirementForm) => request.put<Common<any>>(NewDemands.GetNewFatherRequirementStatus, data);

// 提交测试分支
export const postSubmitTestRequirement = (data: postSubmitTestRequirementForm) => request.post<Common<any>>(NewDemands.PostSubmitTestRequirement, data);

// 查询一个需求
export const PostRequirement = (data: getRequirementForm) => request.post<Common<any>>(NewDemands.PostRequirement, data);

// 查询一个需求
export const PostUpdateRequirementName = (data:any) => request.post<Common<any>>(NewDemands.PostUpdateRequirementName, data);

// 获取【我创建的需求】数据
export const GetCreateRequirement = (data: searchRequirementForm) => request.post<Common<any>>(NewDemands.GetCreateRequirement, data);

// 获取【我待审核的需求】数据
export const GetEnterRequirement = (data: any) => request.post<Common<any>>(NewDemands.GetEnterRequirement, data);

// 审核需求
export const PostReviewRequirementMsg = (data: postReviewRequirementMsgForm) => request.post<Common<any>>(NewDemands.PostReviewRequirementMsg, data);

// 催促审核
export const GetUrgedRequriement = (id: number) => request.get<Common<any>>(`${NewDemands.GetUrged}?id=${id}`);

// 选择技术负责人
export const PutUpdateBossName = (data: putAddOrUpdateRequirementBossNameForm) => request.put<Common<any>>(NewDemands.PutUpdateBossName, data);

// 获取需求审核记录
export const GetRequirementEnterMsg = (id: number) => request.get<Common<any>>(`${NewDemands.GetRequirementEnterMsg}?id=${id}`);

// 提交需求评审会议纪要
export const PutShowNeedTip = (data: putShowNeedTipForm) => request.put<Common<any>>(NewDemands.PutShowNeedTip, data);


// 审核未通过时修改需求
export const PostAgainRequirement = (data: postAgainRequirementForm) => request.post<Common<any>>(NewDemands.PostAgainRequirement, data);

// 获取已经提测，未审核的需求
export const GetMyRequirementNoTip = (data: any) => request.get<Common<any>>(NewDemands.GetMyRequirementNoTip, data);

// 更新需求详情
export const PostUpdateRequirementMsg = (data: any) => request.post<Common<any>>(NewDemands.PostUpdateRequirementMsg, data);

// 技术负责人审核详细设计请求参数
export const PutShowTipJTOY = (data: putShowTipJTOYForm) => request.put<Common<any>>(NewDemands.PutShowTipJTOY, data);

// 需求负责人撤回已关闭需求
export const PutReturnCloseFatherRequirementStatus = (data: putReturnFatherRequirementStatusForm) => request.put<Common<any>>(NewDemands.PutReturnCloseFatherRequirementStatus, data);

// TODO 任务完成
// 任务完成提交数据
export const TaskRequirementSuccess = (data: postTaskRequirementSuccessForm) => request.post<any>(NewDemands.TaskRequirementSuccess, data);

// TODO 需求详情
// 删除已分配人员
export const PostAvgDeleteRequirement = (data: postAvgDeleteRequirementForm) => request.post<Common<any>>(NewDemands.PostAvgDeleteRequirement, data);

// 提交留言
export const PostAddSaidContents = (data: postAddSaidContentsForm) => request.post<Common<any>>(NewDemands.PostAddSaidContents, data);

// 获取所有留言
export const GetSaidContentList = (id: number) => request.get<Common<getSaidContentListData[] | []>>(`${NewDemands.GetSaidContentList}?id=${id}`);

// 获取变更历史
export const GetOperationHistorys = (id: number) => request.get<Common<getOperationHistorysData[] | []>>(`${NewDemands.GetOperationHistorys}?id=${id}`);

// 获取提测记录
export const PostRequriementPullBranch = (data: postRequriementPullBranchForm) => request.post<Common<postRequirementPullBranchData[] | []>>(NewDemands.PostRequriementPullBranch, data);

// 修改已分配任务
export const PutUpdateChildMsg = (data: putUpdateChildMagForm) => request.put<Common<any>>(NewDemands.PutUpdateChildMsg, data);

// 获取任务是否超时
export const GetOutTimeRequirementMsg = (id: number) => request.get<Common<getOutTimeRequirementMsgData>>(`${NewDemands.GetOutTimeRequirementMsg}?id=${id}`);

// 提交超时原因
export const PostOutTimeRequirementMsg = (data: postOutTimeRequirementMsgForm) => request.post<Common<any>>(NewDemands.PostOutTimeRequirementMsg, data);

// 删除任务的提测人员
export const GetDeleteSubmitTestPersion = (id: Number) => request.get<Common<any>>(`${NewDemands.GetDeleteSubmitTestPersion}?id=${id}`)

// 添加提测人员
export const PostAddSubmitTestRequirement = (data: postAddSubmitTestRequirementForm) => request.post<Common<any>>(NewDemands.PostAddSubmitTestRequirement, data);

// TODO 测试中
// 获取提测人员列表
// export const GetJoinTests = (id: number) => request.get<Common<getJoinTestData>[]>(`${NewDemands.GetJoinTests}?id=${id}`);
export const GetJoinTests = (id: number) => request.get<Common<any>>(`${NewDemands.GetJoinTests}?id=${id}`);

// 测试通过时测试对研发评分
export const PutShowTipCTOY = (data: putShowTipCTOYForm) => request.put<Common<any>>(NewDemands.PutShowTipCTOY, data);

// 修改密码
export const PostChangePassword = (data: any) => request.post<Common<any>>(NewDemands.PostChangePassword, data);

// 测试负责人创建的任务测试通过
export const GetUpdateSubmitNotTips = (id: number) => request.get<Common<any>>(`${NewDemands.GetUpdateSubmitNotTips}?id=${id}`);

// 测试不通过时提交bug
export const PostSubmitTestStatus = (data: postSubmitTestStatusForm) => request.post<Common<any>>(NewDemands.PostSubmitTestStatus, data);

//获取存在bug的需求和所有需求
export const GetBugRequirementList = (data: any) => request.post<Common<any>>(NewDemands.GetBugRequirementList, data);

// 根据需求id和过滤条件获取所有bug
export const GetRequirementAllBug = (data: any) => request.post<Common<any>>(NewDemands.GetRequirementAllBug, data);

// 根据bugid更新bug等级
export const UpdateBugLevelById = (data: any) => request.put<Common<any>>(NewDemands.UpdateBugLevelById, data);

// 根据bugid更新bug状态
export const UpdateBugStatusById = (data: any) => request.put<Common<any>>(NewDemands.UpdateBugStatusById, data);

// 根据bugid更新bug修复人
export const UpdateBugEditById = (data: any) => request.put<Common<any>>(NewDemands.UpdateBugEditById, data);

// 根据需求id和过滤条件获取所有bug
export const GetBugStatusList = () => request.get<Common<any>>(NewDemands.GetBugStatusList);

// 根据需求id获取bug列表
export const GetRequirementsBugs = (requirementId: number) => request.get<Common<any>>(`${NewDemands.GetRequirementsBugs}/${requirementId}`);

// 根据需求id获取bug详情
export const FindBugMsgById = (id: any) => request.get<Common<any>>(`${NewDemands.FindBugMsgById}?id=${id}`);

// 根据需求id获取bug评论
export const GetBugMsgById = (id: number) => request.get<Common<any>>(`${NewDemands.GetBugMsgById}?id=${id}`);

// 根据需求id添加bug评论
export const PostAddBugTipsById = (data: any) => request.post<Common<any>>(NewDemands.AddBugTipsById, data);

// 根据需求新建bug
export const PostAddNewRequirementBug = (data: any) => request.post<Common<any>>(NewDemands.AddNewRequirementBug, data);

// 测试人员根据需求id获取给自己提测的研发人员名单
export const GetMySubmitByRequirementChild = (id: number) => request.get<Common<any>>(`${NewDemands.GetMySubmitByRequirementChild}?id=${id}`);

// 需求重新提测
export const PostSubmitTestRequirementTwo = (data: submitTestRequirementTwoForm) => request.post<Common<any>>(NewDemands.PostSubmitTestRequirementTwo, data);

// 研发人员重新提测时获取自己的测试人员名单
export const GetSubmitRequirementList = (id: number) => request.get<Common<any>>(`${NewDemands.GetSubmitRequirementList}?id=${id}`);

// 变更自己的提测记录为测试中
export const GetUpdateMySubmitByRequirementStatus = (id: number) => request.get<Common<any>>(`${NewDemands.GetUpdateMySubmitByRequirementStatus}?id=${id}`);

// 获取提测需求详情
export const GetSubmitTestMsg = (id: number) => request.get<Common<any>>(`${NewDemands.GetSubmitTestMsg}?id=${id}`);

// 测试对测试负责人评价评分
export const PutTestToBossTip = (data: putTestToBossTipForm) => request.put<Common<any>>(NewDemands.PutTestToBossTip, data);


// 上线任务
// 创建上线任务
export const PostCreateOfflineRequirement = (data: any) => request.post<Common<any>>(NewDemands.PostCreateOfflineRequirement, data);

// 获取上线任务列表
export const PostGetOfflineRequirement = (data: any) => request.post<Common<any>>(NewDemands.PostGetOfflineRequirement, data);

// 获取上线任务绑定的需求列表
export const GetGetOnlineTaskRequirements = (id: number) => request.get<Common<any>>(`${NewDemands.GetGetOnlineTaskRequirements}?id=${id}`);

// 删除上线任务
export const GetDeleteOnlineTaskById = (id: number) => request.get<Common<any>>(`${NewDemands.GetDeleteOnlineTaskById}?id=${id}`);

// 更新上线任务名称
export const PostUpdateOfflineRequirement = (data: any) => request.post<Common<any>>(NewDemands.PostUpdateOfflineRequirement, data);

// 选择上线任务的需求
export const PostSelectOfflineRequirements = (data: any) => request.post<Common<any>>(NewDemands.PostSelectOfflineRequirements, data);

// 删除上线任务的一个需求
export const PostDeleteOnlineTaskInTasks = (data: any) => request.post<Common<any>>(NewDemands.PostDeleteOnlineTaskInTasks, data);

// 删除上线任务的一个需求
export const PostAddOnlineTaskInTasks = (data: any) => request.post<Common<any>>(NewDemands.PostAddOnlineTaskInTasks, data);

// 往上线任务中添加一个需求
export const GetGetOfflineRequirementLog = (id: number) => request.get<Common<any>>(`${NewDemands.GetGetOfflineRequirementLog}?id=${id}`);

// 查询上线任务操作记录
export const GetGetOfflineRequirementTrues = (id: number) => request.get<Common<any>>(`${NewDemands.GetGetOfflineRequirementTrues}?id=${id}`);

// 获取可以选择的上线评审的需求
export const PostDetermineOfflineTime = (data: any) => request.post<Common<any>>(NewDemands.PostDetermineOfflineTime, data);

// 指定上线时间
export const PostDetermineOnlineTime = (data: any) => request.post<Common<any>>(NewDemands.PostDetermineOnlineTime, data);

// 指定上线评审时间(支持重新指定也就是修改)
export const PostSelectOnlineTaskBareUsers = (data: any) => request.post<Common<any>>(NewDemands.PostSelectOnlineTaskBareUsers, data);

// 添加上线评审参与人、研发、运维、测试
export const PostAddOnlineTaskInUser = (data: any) => request.post<Common<any>>(NewDemands.PostAddOnlineTaskInUser, data);

// 修改上线评审参与人、研发、运维、测试
export const PostUpdateOnlineTaskInUser = (data: any) => request.post<Common<any>>(NewDemands.PostUpdateOnlineTaskInUser, data);

// 查询上线任务上线参与人
export const GetGetOnlineTaskMsg = (id: number) => request.get<Common<any>>(`${NewDemands.GetGetOnlineTaskMsg}?id=${id}`);

// 删除上线任务上线参与人
export const PostDeleteOnlineTaskInUser = (data: any) => request.post<Common<any>>(NewDemands.PostDeleteOnlineTaskInUser, data);

// 填写上线评审会议纪要
export const PostAddOnlieTaskMeetingNotes = (data: any) => request.post<Common<any>>(NewDemands.PostAddOnlieTaskMeetingNotes, data);

// 填写上线资源
export const PostAddOnlieTaskResources = (data: any) => request.post<Common<any>>(NewDemands.PostAddOnlieTaskResources, data);

// 获取所有可选择保障人员
export const GetGetOnlineTaskGuarantors = () => request.get<Common<any>>(NewDemands.GetGetOnlineTaskGuarantors);

// 获取所有项目经理
export const GetManagerList = () => request.get<Common<any>>(NewDemands.GetManagerList);

// 添加报障人
export const PostAddOnlineTaskGuarantors = (data: any) => request.post<Common<any>>(NewDemands.PostAddOnlineTaskGuarantors, data);

//查询上线任务保障人员
export const GetFindOnlineTaskGuarantors = (id: number) => request.get<Common<any>>(`${NewDemands.GetFindOnlineTaskGuarantors}?id=${id}`);

// 删除上线任务保障人员
export const GetDeleteOnlineTaskGuarantors = (id: number) => request.get<Common<any>>(`${NewDemands.GetDeleteOnlineTaskGuarantors}?id=${id}`);


// 产品版本
// 添加产品版本
export const PostCreateVersion = (data: any) => request.post<Common<any>>(NewDemands.PostCreateVersion, data);
// 添加产品版本
export const PostUpdateVersion = (data: any) => request.post<Common<any>>(NewDemands.PostUpdateVersion, data);
// 产品版本评分
export const PostCreateVersionRating = (data: any) => request.post<Common<any>>(NewDemands.PostCreateVersionRating, data);
// 删除指定产品版本
export const GetDeleteVersion = (id: string) => request.get<Common<any>>(`${NewDemands.GetDeleteVersion}?id=${id}`);
// 获取产品版本列表
export const PostGetVersionList = (data: any) => request.post<Common<any>>(NewDemands.PostGetVersionList, data);

// 超时任务
// 获取所有超时任务
export const PostGetAllTimeOutIrs = (id: string) => request.get<Common<any>>(`${NewDemands.PostGetAllTimeOutIrs}?id=${id}`);

// 获取所有未修复的bug
export const GetGetAllOrMyBugList = (opt: string) => request.get<Common<any>>(`${NewDemands.GetGetAllOrMyBugList}?opt=${opt}`);


// 汇报任务
// 创建汇报任务
export const PostCreateReportMaterial = (data: any) => request.post<Common<any>>(NewDemands.PostCreateReportMaterial, data);
// 提交汇报任务
export const PostUploadReportMaterialFile = (data: any) => request.post<Common<any>>(NewDemands.PostUploadReportMaterialFile, data);

// 删除上线任务
export const GetDeleteReportMaterialById = (id: number) => request.get<Common<any>>(`${NewDemands.GetDeleteReportMaterialById}?id=${id}`);

// 获取汇报任务列表，可以根据条件获取自己或者所有人的
export const PostgetReportMaterialList = (data: any) => request.post<Common<any>>(NewDemands.PostgetReportMaterialList, data);

// 导出汇报材料
export const ExportReportMaterialList = async (data: any) => {
    const response = await request.post(NewDemands.ExportReportMaterialList, data, {
        responseType: 'blob'
    });

    const contentType = response.headers['content-type'];
    const blob = response.data;

    // 检查是否是 JSON
    if (contentType?.includes('application/json')) {
        const text = await new Promise<string>((resolve, reject) => {
            const reader = new FileReader();
            reader.onload = () => resolve(reader.result as string);
            reader.onerror = reject;
            reader.readAsText(blob);
        });

        return JSON.parse(text);
    }

    // 否则返回 Blob
    return blob;
};


// 修改汇报任务的名称
export const PostUpdateReportMaterialName = (data: any) => request.post<Common<any>>(NewDemands.PostUpdateReportMaterialName, data);

// 查看操作历史记录
export const GetGetReportMaterialLogs = (id: number) => request.get<Common<any>>(`${NewDemands.GetGetReportMaterialLogs}?id=${id}`);

// 修改汇报任务的名称
export const PostSubmitReportMaterialAudit = (data: any) => request.post<Common<any>>(NewDemands.PostSubmitReportMaterialAudit, data);

// 审核不通过
export const PostAuditNotBy = (data: any) => request.post<Common<any>>(NewDemands.PostAuditNotBy, data);

// 审核通过
export const PostAuditBy = (data: any) => request.post<Common<any>>(NewDemands.PostAuditBy, data);

// 对处理人评价
export const PostAuditToCreator = (data: any) => request.post<Common<any>>(NewDemands.PostAuditToCreator, data);

// 撤销审核任务
export const GetReturnReportMaterialAudit = (id: number) => request.get<Common<any>>(`${NewDemands.GetReturnReportMaterialAudit}?id=${id}`);

// TODO 待上线评审
// 获取项目经理的待上线评审需求
export const PostManagerRequirement = (data: postManagerRequirementForm) => request.post<Common<any>>(NewDemands.PostManagerRequirement, data);

// 项目经理通知技术负责人上线评审【待上线评审】页面
export const GetManagerOnline = (id: number) => request.get<Common<any>>(`${NewDemands.GetManagerOnline}?id=${id}`);

// 项目经理填写上线评审会议纪要
export const GetSelectBareUsers = (id: number) => request.get<Common<getSelectBareUsersFormData>>(`${NewDemands.GetSelectBareUsers}?id=${id}`);

// 技术负责人分配参与上线人员
export const PostSelectBareUsers = (data: postSelectBareUsersForm) => request.post<Common<any>>(NewDemands.PostSelectBareUsers, data);

// 获取【我的上线任务】页面列表
export const GetMyBareMsg = () => request.get<Common<any>>(NewDemands.GetMyBareMsg);

// 提交上线评审负责内容
export const SubmitBearContent = (data: submitBearContentForm) => request.put<Common<any>>(NewDemands.SubmitBearContent, data);

// 项目经理通知所有上线参与人线下上线评审时间
export const PostOfflineBearContent = (data: postOfflineBearContentForm) => request.post<Common<any>>(NewDemands.PostOfflineBearContent, data);

// 项目经理填写上线评审会议纪要
export const PostOfflineBearContentMsg = (data: postOfflineBearContentMsgForm) => request.post<Common<any>>(NewDemands.PostOfflineBearContentMsg, data);

//获取所有用户
export const GetRoleUser = () => request.get<Common<any>>(NewDemands.GetRoleUser);

// 更新参与上线评审的人各自负责的内容
export const PostUpdateBareUsersMsgs = (data: any) => request.post<any>(NewDemands.PostUpdateBareUsersMsgs, data);

//获取上线参与人列表
export const GetOnlineUsers = (id: number) => request.get<any>(`${NewDemands.GetOnlineUsers}?id=${id}`);

// 提醒编写上线负责任务
export const DingDingOnlineWriteBearContents = (id: number) => request.get<any>(`${NewDemands.DingDingOnlineWriteBearContents}?id=${id}`);

// 获取保障人手机号码
export const GetMyPhoneNumber = (uuid: string) => request.get<Common<any>>(`${NewDemands.GetMyPhoneNumber}?uuid=${uuid}`);

// 获取需求所有测试用例
export const GetFatherTestCaseList = (id: number) => request.get<Common<any>>(`${NewDemands.GetFatherTestCaseList}?id=${id}`);

// TODO 已上线
//获取已上线待评价人员列表
export const GetGetBareUsersMsgs = (id: number) => request.get<Common<any>>(`${NewDemands.GetBareUsersMsgs}?id=${id}`);


// TODO 待上线-技术负责人-【我负责的需求】
// 技术负责人提交上线结果，1、通过；2、不通过
export const PostOfflineToEnd = (data: postOfflineToEndForm) => request.post<Common<any>>(NewDemands.PostOfflineToEnd, data);

// 技术负责人/测试负责人对上线参与人评分
export const PutOnlineEndBearContents = (data: any) => request.put<Common<any>>(NewDemands.PutOnlineEndBearContents, data);

// 上传巡检文档
export const PutSaveMsOnlineEndBearContents = (data: any) => request.put<Common<any>>(NewDemands.SaveMsOnlineEndBearContents, data);

// 待上线-今天上线时间
export const PostSureOnline = (data: any) => request.post<Common<any>>(NewDemands.PostSureOnline, data);

// TODO 项目经理已上线未评价
// 获取项目经理所有已上线未评价需求
export const GetManagerNoToDevRequirements = () => request.get<Common<getManagerNoToDevRequirementsData[] | []>>(NewDemands.GetManagerNoToDevRequirements);

// 项目经理提交评价数据
export const SaveManagerNoToDevRequirements = (data: postSaveManagerNoToDevRequirementsForm) => request.post<Common<any>>(NewDemands.SaveManagerNoToDevRequirements, data);

// TODO 今天上线的任务
export const GetThisDayOnlineRequirement = (data: any) => request.post<Common<any>>(NewDemands.GetThisDayOnlineRequirement, data);

// TODO 测试用例
// 获取任务测试用例
export const GetChildTestCaseList = (id: null | Number) => request.get<Common<any>>(`${NewDemands.GetChildTestCaseList}?id=${id}`);

// 获取所有项目测试用例数
export const GetAllItemCaseNumber = (data: any) => request.post<Common<any>>(NewDemands.GetAllItemCaseNumber, data);

// 获取项目模块对应的用例
export const GetItemModuleCaseList = (data: any) => request.post<Common<any>>(NewDemands.GetItemModuleCaseList, data);

// 查询选中项目的所有需求用例
export const GetItemRequirementCaseList = (data: any) => request.post<Common<any>>(NewDemands.GetItemRequirementCaseList, data);

// 查询选中项目的所有需求
export const GetItemRequirementList = (id: any) => request.get<Common<any>>(`${NewDemands.GetItemRequirementList}?id=${id}`);

// 查询模块已经关联的用例
export const GetLinkeModulList = (id: any) => request.get<Common<any>>(`${NewDemands.GetLinkeModulList}?id=${id}`);

// 取消模块已经关联的用例
export const UnlinkLinkeModulCase = (id: any) => request.get<Common<any>>(`${NewDemands.UnlinkLinkeModulCase}?id=${id}`);

// 查询用例详情
export const GetItemCaseById = (id: any) => request.get<Common<any>>(`${NewDemands.GetItemCaseById}?id=${id}`);

// 删除指定用例
export const DeleteItemCaseById = (id: any) => request.get<Common<any>>(`${NewDemands.DeleteItemCaseById}?id=${id}`);

// 获取项目下的所有需求
export const GetItemRequirementListById = (id: any) => request.get<Common<any>>(`${NewDemands.GetItemRequirementListById}?id=${id}`);

// 获取本月测试新增用例数
export const GetNowMonthAddCaseTotal = () => request.get<Common<any>>(NewDemands.GetNowMonthAddCaseTotal);

// 分页查询需求用例
export const GetFatherTestCaseListPage = (data: any) => request.post<Common<any>>(NewDemands.GetFatherTestCaseListPage, data);

// 审核本月新增用例
export const AuditNowMonthAddCaseById = (data: any) => request.post<Common<any>>(NewDemands.AuditNowMonthAddCaseById, data);

// 获取本月测试新增用例的需求
export const GetNowMonthAddCaseRequirement = (data: any) => request.post<Common<any>>(NewDemands.GetNowMonthAddCaseRequirement, data);

// 根据选中需求的名称获取新增用例
export const GetNowMonthAddCaseByRequirementName = (data: any) => request.post<Common<any>>(NewDemands.GetNowMonthAddCaseByRequirementName, data);

// 更新用例详情
export const UpdateItemCaseById = (data: any) => request.post<Common<any>>(NewDemands.UpdateItemCaseById, data);

// 获取指定项目的用例
export const GetItemCaseListById = (data: any) => request.post<Common<any>>(NewDemands.GetItemCaseListById, data);

// 一级模块和二级模块关联用例
export const AddOneTwoModulItemRequirementList = (data: any) => request.post<Common<any>>(NewDemands.AddOneTwoModulItemRequirementList, data);

// 添加项目一级功能分类
export const AddItemModuleOne = (data: any) => request.post<Common<any>>(NewDemands.AddItemModuleOne, data);

//获取选中一级功能分类的所有二级分类
export const GetItemTwoModuleList = (data: any) => request.post<Common<any>>(NewDemands.GetItemTwoModuleList, data);

// 添加项目二级功能分类
export const AddItemModuleTwo = (data: any) => request.post<Common<any>>(NewDemands.AddItemModuleTwo, data);

// 编辑项目一级功能分类
export const UpdateItemModuleOne = (data: any) => request.post<Common<any>>(NewDemands.UpdateItemModuleOne, data);

// 编辑项目二级功能分类
export const UpdateItemModuletwo = (data: any) => request.post<Common<any>>(NewDemands.UpdateItemModuletwo, data);

// 获取项目测试用例
export const GetByIdItemCase = (id: null | Number) => request.get<Common<any>>(`${NewDemands.GetByIdItemCase}?id=${id}`);

// 导入或上传任务测试用例
export const PostRequirementTestCases = (data: postRequirementTestCasesForm) => request.post<Common<any>>(NewDemands.PostRequirementTestCases, data);

// 获取项目所有一级功能模块
export const GetItemOneModuleList = (id: any) => request.get<Common<any>>(`${NewDemands.GetItemOneModuleList}?id=${id}`);

// 删除一级功能模块
export const GetDeleteItemCaseModuleOneById = (id: any) => request.get<Common<any>>(`${NewDemands.GetDeleteItemCaseModuleOneById}?id=${id}`);

// 删除二级功能模块
export const GetDeleteItemCaseModuleTwoById = (id: any) => request.get<Common<any>>(`${NewDemands.GetDeleteItemCaseModuleTwoById}?id=${id}`);

// 获取已上线需要汇报工作量的需求
export const GetWorkloadList = (data: any) => request.post<Common<any>>(NewDemands.GetWorkloadList, data);

// 导出汇报工作量
export const ExportWorkloadList = async (data: any) => {
    const response = await request.post(NewDemands.ExportWorkloadList, data, {
        responseType: 'blob'
    });

    const contentType = response.headers['content-type'];
    const blob = response.data;

    // 检查是否是 JSON
    if (contentType?.includes('application/json')) {
        const text = await new Promise<string>((resolve, reject) => {
            const reader = new FileReader();
            reader.onload = () => resolve(reader.result as string);
            reader.onerror = reject;
            reader.readAsText(blob);
        });

        return JSON.parse(text);
    }

    // 否则返回 Blob
    return blob;
};

// 获取可选择需求列表
export const GetWorkloadRequirementList = (params?: { type?: number }) => {
  const queryString = params?.type ? `?type=${params.type}` : '';
  return request.get<Common<any>>(`${NewDemands.GetWorkloadRequirementList}${queryString}`);
};
// 更新汇报工作量内容
export const PostUpdateWorkload = (data: any) => request.put<Common<any>>(NewDemands.UpdateWorkload, data);
// 上报工作量
export const PostSubmitWorkloadForm = (data: any) => request.post<Common<any>>(NewDemands.PostReportWorkloadRequirement, data);
// 给项目经理管理者评分评论
export const PostCommentRating = (data: any) => request.post<Common<any>>(NewDemands.PostCommentRating, data);
// 审核上报工作量
export const PostAuditWorkloadRequirement = (data: any) => request.post<Common<any>>(NewDemands.PostAuditWorkloadRequirement, data);
// 获取审核工作量详情
export const GetWorkloadRequirement = (data: any) => request.get<Common<any>>(`${NewDemands.GetWorkloadRequirement}?id=${data}`);
// 查看评审审核记录
export const GetWorkloadRequirementMsg = (data: any) => request.get<Common<any>>(`${NewDemands.GetWorkloadRequirementMsg}?id=${data}`);
// 不汇报工作量
export const NoWorkload = (data: any) => request.get<Common<any>>(`${NewDemands.NoWorkload}?id=${data}`);

// 根据权限获取人员信息
export const GetRoleUsers = (data: any) => request.get<Common<any[]>>(`${NewDemands.GetRoleUsers}?authId=${data}`);

// 获取本人未提交加班申请的需求
export const GetSelfOverTimeCount = () => request.get<Common<any>>(NewDemands.GetSelfOverTimeCount);
//创建加班申请单
export const CreateJobOverTime = (data: any) => request.post<Common<any>>(NewDemands.CreateJobOverTime, data);
//修改加班申请单
export const UpdateJobOverTime = (data: any) => request.post<Common<any>>(NewDemands.UpdateJobOverTime, data);
//完成打印的加班申请单
export const PrintJobOverTimeStatus = (data: any) => request.post<Common<any>>(NewDemands.PrintJobOverTimeStatus, data);
// 导出加班申请单
export const ExportOverTime = (data: any) => request.post<Blob>(NewDemands.ExportOverTime, data, {
    responseType: 'blob'
});
// 获取我的加班申请单列表
export const GetJobOverTimeList = (data: any) => request.post<Common<any>>(NewDemands.GetJobOverTimeList, data);
// 作废加班申请单
export const VoidedJobOverTimeList = (data: any) => request.get<Common<any>>(`${NewDemands.VoidedJobOverTimeList}?id=${data}`);
// 获取加班申请列表
export const GetAuditJobOverTimeList = (data: any) => request.post<Common<any>>(NewDemands.GetAuditJobOverTimeList, data);
// 根据UUID获取加班申请单(管理员)
export const GetAuditJobOverTimeListByUUID = (data: any) => request.post<Common<any>>(NewDemands.GetAuditJobOverTimeListByUUID, data);
// 获取本人签字图片(管理员)
export const GetAuditJobOverTimeMySign = () => request.get<Common<any>>(NewDemands.GetAuditJobOverTimeMySign);
// 查询加班申请单详情
export const GetJobOverTimeById = (data: any) => request.get<Common<any>>(`${NewDemands.GetJobOverTimeById}?id=${data}`);
//审核加班申请单
export const AuditJobOverTimeById = (data: any) => request.post<Common<any>>(NewDemands.AuditJobOverTimeById, data);

// 出差记录表
// 获取所有项目
export const GetItemList = () => request.get<Common<any>>(NewDemands.GetItemList);
// 查询出差记录
export const GetTripList = (data: any) => request.post<Common<any>>(NewDemands.GetTripList, data);
// 导出出差记录
export const ExportReportTrip = (data: any) =>
    request.post<Blob>(NewDemands.ExportReportTrip, data, {
        responseType: 'blob'
    });
//创建出差记录
export const CreateTrip = (data: any) => request.post<Common<any>>(NewDemands.CreateTrip, data);
//修改出差记录
export const UpdateTrip = (data: any) => request.post<Common<any>>(NewDemands.UpdateTrip, data);
// 删除出差记录
export const DeleteTrip = (data: any) => request.get<Common<any>>(`${NewDemands.DeleteTrip}?id=${data}`);

// 会议记录表
//创建会议记录
export const CreateMeeting = (data: any) => request.post<Common<any>>(NewDemands.CreateMeeting, data);
//更新会议记录
export const UpdateMeeting = (data: any) => request.post<Common<any>>(NewDemands.UpdateMeeting, data);
//查询会议记录
export const GetMeetingList = (data: any) => request.post<Common<any>>(NewDemands.GetMeetingList, data);
// 导出出差记录
export const ExportReportMeeting = (data: any) =>
    request.post<Blob>(NewDemands.ExportReportMeeting, data, {
        responseType: 'blob'
    });
// 删除会议记录
export const DeleteMeeting = (data: any) => request.get<Common<any>>(`${NewDemands.DeleteMeeting}?id=${data}`);

// 每日日报表
//创建日报记录
export const CreateDaily = (data: any) => request.post<Common<any>>(NewDemands.CreateDaily, data);
//查询日报记录
export const GetDailyList = (data: any) => request.post<Common<any>>(NewDemands.GetDailyList, data);
//评论日报
export const ToComments = (data: any) => request.post<Common<any>>(NewDemands.ToComments, data);
// 查询日报记录
export const GetDailyById = (data: any) => request.get<Common<any>>(`${NewDemands.GetDailyById}?id=${data}`);
// 查询日报评论记录
export const GetToComments = (data: any) => request.get<Common<any>>(`${NewDemands.GetToComments}?id=${data}`);
// 查询可查看的日报ID列表
export const GetDailySelectIds = (params: { isRead?: number; nickName?: string }) =>
    request.post<Common<number[]>>(NewDemands.GetDailySelectIds, {
        isRead: params?.isRead ?? 2,
        nickName: params?.nickName ?? ''
    });
// 获取可选未完成安排需求
export const GetMyDailyOneToMany = () => request.get<Common<any>>(NewDemands.GetMyDailyOneToMany);
//根据部门查询对应的用户
export const GetDailyUserListByDepartment = (id: string) => request.get<Common<any>>(`${NewDemands.GetDailyUserListByDepartment}?id=${id}`);

// 人员管理
//获取团队人员数据
export const GetTeamUsers = (data: any) => request.post<Common<any>>(NewDemands.GetTeamUsers, data);
//更换头像
export const UploadUserHeadImg = (data: any) => request.post<Common<any>>(NewDemands.UploadUserHeadImg, data);
//新增职位
export const AddPosition = (data: any) => request.post<Common<any>>(NewDemands.AddPosition, data);
//更新职位
export const UpdatePositionById = (data: any) => request.post<Common<any>>(NewDemands.UpdatePositionById, data);
//更新绩效类型
export const UpdatePositionType = (data: any) => request.post<Common<any>>(NewDemands.UpdatePositionType, data);
//绩效职位关联用户
export const AssPositionUser = (data: any) => request.post<Common<any>>(NewDemands.AssPositionUser, data);
// 获取所有的职位
export const GetPositionList = () => request.get<Common<any>>(NewDemands.GetPositionList);
// 获取制定职位的绩效类型
export const GetPositionTypeListByPositionId = (data: any) => request.get<Common<any>>(`${NewDemands.GetPositionTypeListByPositionId}?id=${data}`);
// 获取参与绩效计算的用户
export const GetPositionUser = (data: any) => request.get<Common<any>>(NewDemands.GetPositionUser, data);
// 获取已关联职位的用户
export const GetPositionUserByPositionId = (data: any) => request.get<Common<any>>(`${NewDemands.GetPositionUserByPositionId}?id=${data}`);

// 代办数据

//创建或代办数据
export const CreateUpdateAgency = (data: any) => request.post<Common<any>>(NewDemands.CreateUpdateAgency, data);

//查询代办数据
export const GetAgencyList = (data: any) => request.post<Common<any>>(NewDemands.GetAgencyList, data);
// 删除代办事项
export const DeleteAgencyById = (data: any) => request.get<Common<any>>(`${NewDemands.DeleteAgencyById}?id=${data}`);

// 完成代办事项（POST）
export const OverAgencyById = (data: { id: number; overtimeReason?: string }) => {
    return request.post<Common<any>>(NewDemands.OverAgencyById, data);
};

// 查看代办事项详情
export const CheckAgencyById = (id: number) => request.get<Common<any>>(`${NewDemands.CheckAgencyById}?id=${id}`);


// 老王操作数据
// 获取所有调休加班记录
export const GetOverTimeList = (data: any) => request.post<Common<any>>(NewDemands.GetOverTimeList, data);
// 更新备注信息
export const UpdateOverTimeRemarks = (data: any) => request.post<Common<any>>(NewDemands.UpdateOverTimeRemarks, data);
// 汇总加班调休时长（支持按月份汇总）
export const SummaryJobOverTimeLong = (currentYearMonth: string) =>
    request.get<Common<any>>(`${NewDemands.SummaryJobOverTimeLong}?currentYearMonth=${currentYearMonth}`);
// 重置调休数据
export const ResetJobOverTimeLong = () => request.get<Common<any>>(NewDemands.ResetJobOverTimeLong);
// 获取所有调休加班记录
export const ExportReportLeave = (data: any) =>
    request.post<Blob>(NewDemands.ExportReportLeave, data, {
        responseType: 'blob'
    });
// 录入调休时长
export const UpdateOverTimelong = (data: any) => request.post<Common<any>>(NewDemands.UpdateOverTimelong, data);

// 我的上线
export const MyOfflineRequirement = (data: myOfflineRequirementForm) => request.post<Common<any>>(NewDemands.MyOfflineRequirement, data);
// 更新我的上线任务
export const UpdateMyOfflineRequirement = (data: updateMyOfflineRequirementForm) => request.post<Common<any>>(NewDemands.UpdateMyOfflineRequirement, data);

// 差的日报绩效
// 汇总差的日报绩效
export const SummaryItemPoorDailyReports = (dailyDate?: string) => request.post<Common<any>>(NewDemands.SummaryItemPoorDailyReports, { dailyDate });
// 获取汇总后差的日报绩效
export const GetSummaryItemPoorDailyReports = () => request.get<Common<any>>(NewDemands.GetSummaryItemPoorDailyReports);
// 重新汇总差的日报绩效
export const ResetSummaryItemPoorDailyReports = (dailyDate?: string) => request.post<Common<any>>(NewDemands.ResetSummaryItemPoorDailyReports, { dailyDate });
// 差的日报绩效存为历史数据
export const SaveSummaryItemPoorDailyReports = () => request.get<Common<any>>(NewDemands.SaveSummaryItemPoorDailyReports);

// 日报重复率绩效
// 汇总日报重复率绩效
export const SummaryItemDailyReportRepetitionRate = (dailyDate?: string) => request.post<Common<any>>(NewDemands.SummaryItemDailyReportRepetitionRate, { dailyDate });
// 获取汇总后日报重复率绩效
export const GetSummaryItemDailyReportRepetitionRate = () => request.get<Common<any>>(NewDemands.GetSummaryItemDailyReportRepetitionRate);
// 重新汇总日报重复率绩效
export const ResetSummaryItemDailyReportRepetitionRate = (dailyDate?: string) => request.post<Common<any>>(NewDemands.ResetSummaryItemDailyReportRepetitionRate, { dailyDate });
// 日报重复率绩效存为历史数据
export const SaveSummaryItemDailyReportRepetitionRate = () => request.get<Common<any>>(NewDemands.SaveSummaryItemDailyReportRepetitionRate);